#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int subtractProductAndSum(int n) {
    int sc = 1;
    int sum = 0;
    int sc1 = n;
    int sum1 = n;
    while (sc1)
    {
        sc *= (sc1 % 10);
        sc1 /= 10;
    }
    while (sum1)
    {
        sum += (sum1 % 10);
        sum1 /= 10;
    }
    int c = sc - sum;
    return c;
}

int main()
{
    subtractProductAndSum(234);
	return 0;
}